<%@ page language="java" pageEncoding="UTF-8"%>


<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>添加导航</title>
		<link href="../css/mngMain.css" type="text/css" rel="stylesheet" />

		<script type="text/javascript" src="../js/jquery.js"></script>
		<script type="text/javascript">
 
   function validateTopicname(){
   
      var name=$("#name_jq").attr('value');
      $("#name_message").html("");             
  	  $("#name_message").css("text-align","left");
      $("#name_message").css("color","red");  
  	  if((name==undefined)||(name==null)){
  			$('#name_message').html("(导航标题不能为空.)");
  			return false;
  	  }
   
      var url=$("#url_jq").attr('value');
      $("#url_message").html("");             
  	  $("#url_message").css("text-align","left");
      $("#url_message").css("color","red");  
  	  if((url==undefined)||(url==null)){
  			$('#url_message').html("(导航链接不能为空.)");
  			return false;
  	  }
   
      var location=$("#location_jq").attr('value');
      $("#location_message").html("");             
  	  $("#location_message").css("text-align","left");
      $("#location_message").css("color","red");  
  	  if((location==undefined)||(location==null)){
  			$('#location_message').html("(导航顺序不能为空.)");
  			return false;
  	  }
      else if(!location.match(/^\d{1,11}$/)){
			$("#location_message").html("(请正确输入顺序数字)");
			return false;
		}
	return true;
}
   $(function(){ 
     $("#topicSubmit").click(function(){         
        	 if(validateTopicname()){        	 
		      $("#topicForm").submit();
        	 }	       		  
    });
   });     
</script>
	</head>

	<body>
		<div class="controlBox">
			<%@include file="../admin_top.jsp"%>
			<div class="mngMain">
				<div class="mngLeft">
					<%@include file="../admin_menu.jsp"%>
				</div>
				<div class="mngRight">
					<div class="mngRightContainer">
						<div class="mngRightContainerT">
							添加导航
						</div>
						<div class="mngRightContainerM">
							<html:form action="addNavigate.do" method="post"
								enctype="multipart/form-data" styleId="topicForm">
								<table class="addUser">
									<tr>
									<th width="70px"></th>
									<td><font color="red"> <bean:write name="info"
													ignore="true" filter="false" /> </font></td>
									</tr>
									<tr>
										<th>
											导航标题：
										</th>
										<td>
											<html:text styleId="name_jq" name="addNavigateForm"
												property="name" />
											<span id="name_message"></span>
										</td>
									</tr>
									<tr>
										<th>
											导航url：
										</th>
										<td><html:text name="addNavigateForm" styleId="url_jq"
												property="url" /><span id="url_message"></span></td>
											
									</tr>
									<tr>
										<th>
											悬挂位置：
										</th>
										<td>
											<html:select name="addNavigateForm" property="type">
												<html:option value="0">
													不显示
												</html:option>
												<html:option value="1">
													主菜单
												</html:option>
												<html:option value="2">
													导航条
												</html:option>
											</html:select>
										</td>
									</tr>
									<tr>
										<th>
											导航顺序：
										</th>
										<td>
											<html:text name="addNavigateForm" styleId="location_jq"
												property="location" />
											<span id="location_message"></span>
										</td>
									</tr>
									<tr>
										<th></th>
										<td>
											<a href="#" id="topicSubmit">确定</a>
											<a href="javascript:history.back(-1)">返回</a>
										</td>
									</tr>
								</table>
							</html:form>
						</div>
					</div>
				</div>
			</div>
			<div class="mngBottom">
				<div class="mngLine"></div>
			</div>
		</div>
	</body>
</html>
